<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use yii\widgets\Pjax;

/* @var $this yii\web\View */
/* @var $searchModel admin\modules\rbac\models\ActionSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Actions');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="action-index">
    <?php Pjax::begin(); ?>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a(Yii::t('app', 'Create Action'), ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'kartik\grid\SerialColumn'],
            ['class' => 'kartik\grid\ActionColumn'],
            [
                'class' => \kartik\grid\DataColumn::class,
                'label' => '更多操作',
                'format' => 'raw',
                'mergeHeader' => true,
                'value' => function ($model) {
                    return Html::a(\kartik\icons\Icon::show('universal-access'), ['allot-role', 'action_id' => $model->id], ['title' => '分配角色']);
                }
            ],
            'id',
            'yii2_app_id',
            'uri',
            'name',
            'created_at',
            'created_by',
            'desc:ntext',
        ],
    ]); ?>
    <?php Pjax::end(); ?>
</div>
